<template>
    <div class="block_main blue-tit">
        <!-- <div class="nytit">首页&gt;通知/督办</div> -->
        <el-row style="padding-top: 10px">
            <el-col :span="24" style="padding:0 5px">
                <el-card>
                    <!-- 表格内容 -->
                    <el-table
                        :data="tableData"
                        border
                        style="width: 100%"
                        v-loading="loading"
                        @row-click="seeDetail"
                    >
                        <el-table-column type="index" width="70" label="序号" fixed></el-table-column>
                        <el-table-column
                            prop="from"
                            v-if="!isShowObj.areaShow"
                            label="来源"
                            width="150"
                            :formatter="formatFrom"
                        ></el-table-column>
                        <el-table-column prop="progress" label="状态" v-if="isShow" width="80">
                            <template slot-scope="scope">
                                <span v-if="scope.row.progress == null" class="warn">开始</span>
                                <span
                                    v-if="scope.row.progress == 1 || scope.row.progress == 2"
                                    class="warn"
                                >已移交</span>
                                <span v-else-if="scope.row.progress == 3" class="green">已受理</span>
                                <span
                                    v-else-if="scope.row.progress == 4 || scope.row.progress == 5 || scope.row.progress == 6"
                                    class="green"
                                >已办结</span>
                                <span v-else-if="scope.row.progress == 7" class="green">已评价</span>
                                <span v-else-if="scope.row.status == 4" class="red">已超时</span>
                            </template>
                        </el-table-column>
                        <el-table-column prop="status" v-if="status == '1'" label="状态" width="150"></el-table-column>

                        <el-table-column prop="gname" label="诉求分类" width="160"></el-table-column>
                        <el-table-column prop="company" label="企业名称" width="250">
                            <template slot-scope="scope">
                                <div style="text-align:left;">{{scope.row.company}}</div>
                            </template>
                        </el-table-column>
                        <el-table-column prop="addtime" label="创建时间"></el-table-column>
                        <el-table-column prop="target" label="处理部门"></el-table-column>
                    </el-table>
                </el-card>
            </el-col>
        </el-row>
    </div>
</template>
<script>
import actionurl from "@/assets/js/actionurl";
import config from "@/config.js";

export default {
    components: {},
    props: {
        tableData: {
            type: Array
        },
        isShow: {
            type: Boolean
        },
        isShowObj: {
            type: Object
        }
    },
    data() {
        return {
            dialogVisible: false,
            dialogTit: "",
            fileList3: [],
            uploadFile: false,
            test: "",
            status: "",
            moveTarget: "",
            movegname: "",
            loading: false,
            MessageGroupArr: "",
            copyObj: {},
            supplement: "",
            EditForm: {
                company: ""
            },
            statusFa: ""
        };
    },
    watch: {
        // tableData: {
        //     handler(newValue, oldValue) {
        //         console.log(newValue, "121212");
        //          this.statusFa = newValue.status;
        //     }
        // }
    },
    methods: {
        formatFrom(row, column) {
            return row.from == 0
                ? "微信"
                : row.from == 1
                ? "热线"
                : row.from == 2
                ? "平台"
                : row.from == 3
                ? "在线客服"
                : row.from == 4
                ? "民营经济分析系统"
                : row.from == 5
                ? "面对面帮扶"
                : row.from == 7
                ? "线下服务"
                : "其他";
        },
        doneOver(row) {
            this.$emit("childObjDone", row);
        },
        Edit(row) {
            this.$emit("childObjEdit", row);
        },
        Del(row) {
            this.$emit("childObjDel", row);
        },

        moveTo(row) {
            //修改事件
            this.$emit("childObjmoveTo", row);
            // this.dialogVisible = true;
            // this.EditForm = Object.assign({}, this.tableData)[index];
            // this.EditForm = JSON.parse(JSON.stringify(this.tableData[index]))
            // console.log(JSON.parse(JSON.stringify(this.tableData[index])));
        },
        approval(row) {
            //核准
            this.$emit("childObjApproval", row);
        },
        Accept(row) {
            //受理
            this.$emit("childObjAccept", row);
        },
        complain(row) {
            //申诉
            this.$emit("childObjcomplain", row);
        },
        superDetail(row) {
            //督办按钮

            this.$router.push({
                path: "/supervise/" + row.id
            });
        },
        seeDetail(row) {
            this.$router.push({
                path: "/supervise/" + row.question_num + "/1"
            });
        },
        Filter() {
            // this.loading = true;
            // this.MessageList();
        }
    },
    created() {
        // console.log(this.$parent);
        this.httpHome = config.URLWEBHTTP;
    },
    mounted() {
        // this.MessageList();
    }
};
</script>
<style scoped lang="scss">
.persent {
    width: 80%;
    height: 10px;

    display: flex;
    justify-content: space-between;
    position: relative;
    padding-right: 40px;

    span {
        background: #ccc;
        width: 100%;
        line-height: 10px;

        b {
            background: green;
            width: 100%;
            height: 100%;
            display: inline-block;
            float: left;
        }
    }

    em {
        line-height: 10px;
        position: absolute;
        right: 0;
    }
}

.demo-table-expand {
    font-size: 0;
}

.demo-table-expand label {
    width: 90px;
    color: #99a9bf;
}

.demo-table-expand .el-form-item {
    margin-right: 0;
    margin-bottom: 0;
    width: 90%;
}

.layerup {
    h2 {
        font-size: 18px;
        font-weight: normal;
        text-align: center;
        margin-bottom: 15px;
    }

    span {
        width: 46%;
        line-height: 20px;
    }

    p {
        display: flex;
        justify-content: space-between;
        color: #999;
        margin-bottom: 10px;
    }

    hr {
        border: 1px solid #f5f5f5;
        margin-top: 15px;
    }
}

.titlehover {
    cursor: pointer;

    &:hover {
        color: #1d82d2;
    }
}
.btnflex {
    display: flex;
    width: 100%;
    p {
        margin-right: 20px;
    }
}
.el-dialog__body {
    padding: 0 20px;
}
</style>
